package cn.santi.emuns;


import cn.santi.utli.Result;

public class ResultHelper {

    public static Result ok(){
        return new Result(ResultCodeEnum.SUCCESS.getCode() , ResultCodeEnum.SUCCESS.getLable());
    }

    public static Result ok(Object data){
        return new Result(ResultCodeEnum.SUCCESS.getCode() , ResultCodeEnum.SUCCESS.getLable() , data);
    }

    //默认异常 系统异常
    public static Result error(){
        return new Result(ResultCodeEnum.SYS_ERROR.getCode() , ResultCodeEnum.SYS_ERROR.getLable());
    }

    public static Result error(ResultCodeEnum rc){
        return new Result(rc.getCode() , rc.getLable());
    }

    public static Result error(int code , String label){
        return new Result(code , label);
    }

}
